package cn.service.service.impl;

import cn.service.entiy.Order;
import cn.service.feign.OrderFeign;
import cn.service.service.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Map;

@Service
public class OrderFeignServiceImpl implements OrderFeignService {

    @Autowired
    private OrderFeign orderFeign;

    @Override
    public int buyGoods(Order order) {
        int id=orderFeign.buyGoods(order);
        return id;
    }

    @Override
    public ArrayList<Order> getBill(Long beginDate, Long endDate) {
        Map<String, Long> map = Map.of("beginDate", beginDate, "endDate", endDate);
        System.out.println(beginDate+"    "+endDate);
        return orderFeign.getBill(map);
    }
}
